import java.util.Arrays;
import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: adol book
 * Date: 2022-04-21
 * Time: 0:32
 */

public class test {
    public int age;
    String name;

    public test(int age, String name) {
        this.age = age;
        this.name = name;
    }
    @Override
    public String toString() {  //重写toString方法，可以打印出创建对象里的内容，若是没有重下，则打印出的是地址
        return "test{" +
                "age=" + age +
                ", name='" + name + '\'' +
                '}';
    }

    public static void main(String[] args) {
        test person = new test(18,"lili");
        System.out.println(person);
    }
    public void fun(){
        int b;
    }
    static void fum2(){
        int g;
    }


    static class Fun{
        public static void mothon(){
            int i;
           // b = 3; // 静态内部类只能访问外部类中的静态成员
            //g = 3;
            //fun(); // 同理，静态内部类中只能访问外部类中的静态方法
            fum2();

        }
    }
    public static void main4(String[] args) {
          Fun fun1 = new Fun();
          fun1.mothon(); //创建静态内部类对象不需要创建外部内对象
    }
    public static int fib(int i){
        if(i == 1 || i == 2){
            return 1;
        }
      return (fib(i-1)+fib(i-2));
    }
    public static void main3(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入月份！");
        int month = scanner.nextInt();
        System.out.println(fib(month));
    }

    /**
     *
     * 数组逆序
     * @param array
     */
    public static void fun(int[] array){
        int left = 0;
        int rigth = array.length-1;
        int m = 0;
        while (left < rigth ){
            m = array[left];
            array[left] = array[rigth];
            array[rigth] = m;
            left++;
            rigth--;
        }
    }
    public static void main2(String[] args) {
        int[] array1 = {12, 2, 4, 6};
        fun(array1);
        System.out.println(Arrays.toString(array1));
    }
    /**
     *打印以下图片
     * @param args
     */
    public static void main1(String[] args) {
        System.out.println('*');
        System.out.println("**");
        System.out.println("***");
        System.out.println("****");
        System.out.println("*****");
        System.out.println("******");

    }
}
